%%% ============================================================================
%%% 文件内容：地震动参数表
%%% 
%%% ============================================================================
%%% ----------------------------------------------------------------------------
%%% 计算纪录数目，不要进行修改
%%% ----------------------------------------------------------------------------
\def\TempHorCount{0}
\def\TempVerCount{0}
\csvreader[head to column names,
  filter expr ={
  test{\ifcsvstrcmp{\NP}{}} 
  }
  ]{tables/地震动参数.csv}{}{
    \ifcsvstrcmp{\方向}{水平向}%
    {\pgfmathsetmacro{\TempHorCount}{\TempHorCount+1}}
    {\pgfmathsetmacro{\TempVerCount}{\TempVerCount+1}}
  }
%%% ----------------------------------------------------------------------------
\begin{tabularx}{\linewidth}{?c|l*{7}{|Y}?}
\toprule
& 超越概率 & \multicolumn{1}{c|}{PGA ($g$)} & \multicolumn{1}{c|}{$\alpha_\text{max}$} & \multicolumn{1}{c|}{$C_1$} & \multicolumn{1}{c|}{$C_2$} & \multicolumn{1}{c|}{$T_1$} & \multicolumn{1}{c|}{$T_2$} & \centering\arraybackslash $R$
\csvreader[
  head to column names,
  filter expr ={
      test{\ifcsvstrcmp{\NP}{}} and
      test{\ifcsvstrcmp{\方向}{水平向}}
    }
]{tables/地震动参数.csv}{}{
  \csviffirstrow{\\ \midrule \multirow{5}*{水平向}}{\\ \cline{2-9}}  & \超越概率 & \Pga & \Alphamax & \系数I & \系数II & \周期I & \周期II & \指数
  }
\csvreader[
  head to column names,
  filter expr ={
      test{\ifcsvstrcmp{\NP}{}} and
      test{\ifcsvstrcmp{\方向}{垂直向}}
    }
]{tables/地震动参数.csv}{}{
  \csviffirstrow{\\ \midrule \multirow{5}*{垂直向}}{\\ \cline{2-9}}  & \超越概率 & \Pga & \Alphamax & \系数I & \系数II & \周期I & \周期II & \指数
  }
\\
\bottomrule
\end{tabularx}